#!/bin/sh
rm -f c.img
# Harddisk geometry: 63 sectors; 16 heads; 8 cylinders, 512 bytes per sector.
# bximage will create a file whose size is 63 * 16 * 8 * 512 bytes, NOT 4 * 1024 * 1024 bytes.
/home/zyf/root/bin/bximage -hd -mode=flat -size=4 -q c.img
# Two partitions are created, c is 7 cylinders; d is 1 cylinders.
# mpartition will search ~/.mtoolrc for partition information.
mpartition -I c:
mpartition -c -s 63 -t 7 -h 16 c:
mpartition -c -s 63 -t 1 -h 16 -b 7056 d:
dd if=trampoline.bin of=c.img conv=notrunc
dd if=bootmain.bin of=c.img seek=1 bs=512 conv=notrunc
# Currently, zeroimage.bin and every elf occupy 63 * 2 sectors -- 2 cylinders.
dd if=zeroimage.bin of=c.img seek=63 bs=512 conv=notrunc
dd if=cxxfix.test.elf of=c.img seek=189 bs=512 conv=notrunc
dd if=cxxpic.test.elf of=c.img seek=315 bs=512 conv=notrunc
dd if=corbafix.test.elf of=c.img seek=441 bs=512 conv=notrunc
dd if=corbapic.test.elf of=c.img seek=567 bs=512 conv=notrunc
# dd if=fix.elf of=c.img seek=567 bs=512 conv=notrunc
# dd if=pic.elf of=c.img seek=693 bs=512 conv=notrunc
